<template>
  <div>
    <div class="dashboard-editor-container">
      <agent-group/>

      <StoreData :isCommon="true"></StoreData>


      <!--      <el-row>-->
      <!--        <el-col>-->
      <!--          <div class="chart-wrapper">-->
      <!--            <p>近一个月店铺销售排行（销售金额累计TOP20）</p>-->
      <!--            <div class="chart-wrapper-box">-->
      <!--              <el-table-->
      <!--                :header-cell-style="{'text-align':'center'}"-->
      <!--                :cell-style="{'text-align':'center'}"-->
      <!--                :data="dpxsData"-->
      <!--                border-->
      <!--                style="width: 100%"-->
      <!--                v-loading="dpxsloading"-->
      <!--              >-->
      <!--                <el-table-column prop="index" label="序号" width="50">-->
      <!--                </el-table-column>-->
      <!--                <el-table-column prop="userName" label="店铺账号"></el-table-column>-->
      <!--                <el-table-column prop="shopName" label="店铺名"></el-table-column>-->
      <!--                <el-table-column prop="orderNumber" label="订单数"/>-->
      <!--                <el-table-column prop="saleNumber" label="销售金额"/>-->
      <!--                <el-table-column prop="profitAmount" label="利润"/>-->
      <!--                <el-table-column prop="profitRate" label="利润率"/>-->
      <!--                <el-table-column prop="officeName" label="所属分公司"/>-->
      <!--              </el-table>-->
      <!--              <pagination-->
      <!--                v-show="dpxstotal>0"-->
      <!--                :total="dpxstotal"-->
      <!--                :page.sync="dpxsParams.pageNum"-->
      <!--                :limit.sync="dpxsParams.pageSize"-->
      <!--                @pagination="getAgentShopSaleRankingMonthData"-->
      <!--              />-->
      <!--            </div>-->
      <!--          </div>-->
      <!--        </el-col>-->
      <!--      </el-row>-->

      <notice/>
    </div>

  </div>

</template>

<script>
import AgentGroup from '../../dashboard/AgentGroup'
import BonusPool from '../../dashboard/BonusPool'
import Notice from '../../dashboard/Notice'
import StoreData from "@/views/dataSearch/storeData.vue";
import {
  AgentBounsPoolData,
  AgentShopSaleRankingMonthData
} from "@/api/index/index"

export default {
  name: 'agentPage',
  components: {
    AgentGroup,
    BonusPool,
    Notice,
    StoreData
  },
  data() {
    return {
      bounsPoolData: {}, // 奖金池
      dpxsData: [],
      dpxsloading: true,
      dpxsParams: {
        pageSize: 10,
        pageNum: 1
      },
      dpxstotal: 0
    }
  },
  created() {
    this.getAgentBounsPoolData();
    this.getAgentShopSaleRankingMonthData();
  },
  methods: {
    // 奖金池
    getAgentBounsPoolData() {
      AgentBounsPoolData().then(res => {
        this.bounsPoolData = res.data;
      })
    },
    // 近一个月店铺销售排行（销售金额累计TOP20）
    getAgentShopSaleRankingMonthData() {
      this.dpxsloading = true;
      AgentShopSaleRankingMonthData(this.dpxsParams).then(res => {
        this.dpxsData = res.records;
        this.dpxstotal = res.total;
        this.dpxsloading = false;
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .chart-wrapper {
    background: #fff;
    padding: 20px 16px 0;
    margin-bottom: 32px;

    .chart-wrapper-box {
      padding-bottom: 20px;
    }

    p {
      font-size: 16px;
      line-height: 18px;
      margin: 0 0 15px;
      color: #666;
    }
  }
}
</style>
